﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Threading;
using System.Globalization;

using NSpotifyLib.Interfaces;

namespace NSpotifyLib
{
    internal class AlbumSearcher : BaseSearcher<Album>, IEntitySearcher<Album>
    {
        private const string searchPrefix = "search/1/album?q=";

        internal AlbumSearcher(ISpotifyHTTPReader spotifyHTTPReader) : base(spotifyHTTPReader)
        {
        }

        public IEnumerable<Album> Search(string criteria)
        {
            document = spotifyHTTPReader.GetSpotifyData(searchPrefix + criteria);
            reader = new AlbumReader(document);
            return reader.Read();
        }
    }
}
